package cg.studio.algorithm.graph;

import org.junit.Test;

public class GraphTester
{
  @Test
  public void testRoute()
  {
    GraphTypicalImpl graph = new GraphTypicalImpl();
    Point a = new Point("a");
    Point b = new Point("b");
    Point c = new Point("c");
    Point d = new Point("d");
    Point e = new Point("e");
    Point f = new Point("f");
    Point g = new Point("g");
    
    graph.addEdge( new Edge( a, b ) );
    graph.addEdge( new Edge( a, d ) );
    graph.addEdge( new Edge( b, c ) );
    graph.addEdge( new Edge( b, e ) );
    graph.addEdge( new Edge( c, f ) );
    graph.addEdge( new Edge( d, e ) );
    
    graph.addEdge( new Edge( d, c ) );
    graph.addEdge( new Edge( d, f ) );
    graph.addEdge( new Edge( e, c ) );
    graph.addEdge( new Edge( e, f ) );
    graph.addEdge( new Edge( f, g ) );
    
    /***
    System.out.println( "getOneRoute" );
    Route route = graph.getOneRoute( a, f );
    System.out.println( route );
    /***/
    
    /***
    System.out.println( "getRoutes" );
    Route[] routes = graph.getRoutes( a, f );
    for( Route r : routes )
    {
      System.out.println( r );
    }
    /***/
    
    /***/
    Route route = graph.getShortestJumpRoute( a, g );
    System.out.println( route );
    /***/
  }
}
